package com.example.testgit.controller;

import com.example.testgit.VO.*;
import com.example.testgit.service.CourseResearchService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: lyh
 * @create: 2023/5/8 10:28
 * Description：
 */
@RestController
@RequestMapping("/course_research")
public class CourseResearchController {

    @Resource
    private CourseResearchService courseResearchService;

    /**
     * 根据学号查询学生选课成绩列表
     * @param
     * @return
     */
    @PostMapping("/score")
    public Result<PageResult<CourseVO>> queryScore(@RequestBody StudentQuery stu) {
        PageResult<CourseVO> result = courseResearchService.queryScore(stu);
        return Result.success(result);
    }

    /**
     * 根据学号查询学生科研成果列表
     * @param
     * @return
     */
    @PostMapping("/research")
    public Result<PageResult<ResearchVO>> queryResearch(@RequestBody StudentQuery stu) {
        PageResult<ResearchVO> result = courseResearchService.queryResearch(stu);
        return Result.success(result);
    }
}
